<?php

namespace We7Test\Models\Accapp;

use Illuminate\Database\Eloquent\Model;
// use Illuminate\Database\Eloquent\SoftDeletes;

class User extends Model
{
    protected $table = 'users';

	public function __construct(array $attributes = [])
	{
		parent::__construct($attributes);
		$this->table = str_replace('`', '', tablename($this->table));
    }

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name','username', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    

    //phpunit 测试代码
    public function add($a,$b)
    {
       return $a+$b;
    }
   
    
    public function hasOneUserGroup()
    {
        return $this->hasOne('App\Http\Models\Admin\UserGroup', 'id','group_id');
    }

    
    
}
